-
Notifications
You must be signed in to change notification settings - Fork 119
Polling confirmations (under Experimental spi) #1115
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
younata
wants to merge
11
commits into
swiftlang:main
Choose a base branch
from
younata:polling-expectations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,091
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
younata
commented
May 19, 2025
younata
commented
May 19, 2025
younata
commented
May 19, 2025
younata
commented
May 19, 2025
younata
commented
May 19, 2025
Additionally, make PollingBehavior an implementation detail of polling, instead of exposed publicly Removes any timeouts involved for polling, as they become increasingly unreliable as the system runs more and more tests
…figuration trait Stop unnecessarily waiting after the last polling attempt has finished. Allow for subsequent polling configuration traits which specified nil for a value to fall back to earlier polling configuration traits before falling back to the default.
These two mirror their confirm counterparts, only throwing an error (instead of recording an issue) when they fail.
…the PollingRecorder actor. Now, this uses a separate method for evaluating polling to remove that actor.
Removed the duplicate poll method, and made evaluate-returning-bool into a wrapper for evaluate-returning-optional
This is less direct, but much more intuitive for test authors. Also add exit tests confirming that these values are non-negative
Follow more english-sentence-like guidance for function naming Simplify the polling confirmation API down to just 2 public functions, 1 enum, and 1 error type. Always throw an error when polling fails, get rid of the separate issue recording.
Instead of mulitple traits per stop condition, just have a single trait per stop condition.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
api-proposal
API proposal PRs (documentation only)
enhancement
New feature or request
issue-handling
Related to Issue handling within the testing library
macros
🔭 Related to Swift macros such as @Test or #expect
public-api
Affects public API
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements polling confirmations, as described in ST-NNNN.
Motivation:
Being able to monitor changes in the background is something of immense value. Swift Testing already provides an API for this in the
confirmation
api. However, I've found theconfirmation
to be hard to work with at times - it requires you to set up a callback for when something changes, which is not always possible or even the right thing to do. Polling provides a very general approach to monitoring all kinds of changes.Modifications:
This adds a new set of macros for handling polling. A new public enum for the 2 separate polling behaviors, and new types to actually implement polling. All under the experimental spi.
Checklist: